<?php
// Our include
define('WP_USE_THEMES', false);
require_once('../../../wp-load.php');

// Our variable
$postId = (isset($_GET['postId'])) ? $_GET['postId'] : 1;

//echo "<h1>PostId: ".$postId."</h1>";

$args = array(
	'post_type' => 'post',
	'p' => $postId
);
query_posts($args);
while (have_posts()): the_post();
?>

    <div class="title">
        <?php the_title(); ?>
    </div>
    <div class="text">
        <?php the_content(); ?>
    </div>
    <div class="meta">
        <div class="share">
            <span st_url='<?php the_permalink(); ?>' st_title='<?php the_title(); ?>' st_via='' st_image='<?php the_post_thumbnail('small'); ?>' class='st_facebook_hcount' displayText='Facebook'></span>
            <span st_url='<?php the_permalink(); ?>' st_title='<?php the_title(); ?>' st_via='' st_image='<?php the_post_thumbnail('small'); ?>' class='st_twitter_hcount' displayText='Twitter'></span>
            <span st_url='<?php the_permalink(); ?>' st_title='<?php the_title(); ?>' st_via='' st_image='<?php the_post_thumbnail('small'); ?>' class='st_googleplus_hcount' displayText='Google +'></span>
        </div>
        <div class="date">
            <?php the_time('j M y'); ?>
        </div>
    </div>
<?php
    $prev_post = get_previous_post();
    if (! empty($prev_post) ) { ?>
        <div id="prev-post-link" style="display: none;" ><?php echo $prev_post->ID; ?></div>
<?php
    }
    $next_post = get_next_post();
    if (! empty($next_post) ) { ?>
        <div id="next-post-link" style="display: none;" ><?php echo $next_post->ID; ?></div>
<?php
    }
endwhile;

?>

    
<?php
wp_reset_query();
?>
